import { DisableDto, DisableRes, PostRes } from "~/rest";

import { Gateway, getGateway } from "@/droplet-bus/core.define";

import { app_gateway } from "./core.local";
import { RefVoucherMedia, Voucher } from "./schema.voucher";
import { Media } from "@/pond-media/schema.media";

/** 凭证的图像 */
export const RefVoucherMediaGateway: Gateway = getGateway(app_gateway, "river_voucher_media");
export type putVoucherMediaDto = { voucherId: Voucher["uuid32"]; mediaId: Media["id"] };
export type deleteVoucherMediaDto = DisableDto;
export interface VoucherMediaInterfaceWithGrant<T> {
  putVoucherMedia(dto: T & putVoucherMediaDto): Promise<PostRes<RefVoucherMedia>>;
  deleteVoucherMedia(dto: T & deleteVoucherMediaDto): Promise<DisableRes>;
}
